<template>
	<!-- 车辆详情 -->
	<view class="carDetail">
		<view class="defails-item">
			<view class="item-title">
				<view></view>
				<view>车辆信息</view>
				<view>
					<navigator url="../monthCard/monthCard" hover-class="navigator-hover">购买月卡 </navigator>
				</view>
			</view>
			<view class="item-content host">
				<view class="row"><text>车牌号</text><text>{{tableData.carNum}}</text></view>
				<view class="row"><text>车辆品牌</text><text>{{tableData.carType.carType}}</text></view>
				<view class="row"><text>车辆型号</text><text>{{tableData.model}}</text></view>
				<view class="row"><text>车身颜色</text><text>{{tableData.carColor}}</text></view>
				<view class="photo">
					<text>车辆图片</text>
					<view id="t1">
						<uni-file-picker disable-preview :del-icon="false" return-type="object"
							:image-styles="imageStyles" />
						</uni-file-picker>
					</view>
					<view class="t2">
						<uni-file-picker disable-preview :del-icon="false" return-type="object"
							:image-styles="imageStyles" />
						</uni-file-picker style="margin-bottom:150rpx;">
					</view>
				</view>
			</view>

		</view>
		<view class="operate">
			<navigator url="../../myHouse/addHouse/addHouse" hover-class="navigator-hover">
				<view class="edit">修改</view>
			</navigator>
			<view class="del" @click="open">删除</view>
		</view>
		<uni-popup ref="popup" type="bottom">
			<view class="tishi">
				<view class="tishi-top">确定删除此车辆信息吗？</view>
				<view class="tishi-sel">
					<text @click="close">否</text>
					<navigator url="../myHouse" hover-class="navigator-hover">
						<text @click="close">是</text>
					</navigator>
				</view>
			</view>
		</uni-popup>
	</view>



</template>

<script>
	import { http } from '../../../utils/http.js'
	export default {
		data() {
			return {
				active: 2,
				tableData:{},
				// list1: [{
				// 	title: '房屋信息',

				// }, {
				// 	title: '住户信息'
				// }, {
				// 	title: '物业审核'
				// }, {
				// 	title: '认证成功'
				// }],
				imageStyles: {
					width: 318,
					height: 120,
					// backgroundColor: "#f3f7ff",
					border: {
						color: "#ccc",
						width: 2,
						style: 'solid',
						radius: '2px'
					},
				},

			};
		},
		methods: {
			open() {
				this.$refs.popup.open('top')
			},
			close() {
				this.$refs.popup.close()
			},
			// delsuccess() {
			// 	this.$refs.delsuccess.open('top')
			// }
		},
		
		onLoad(option) {
			console.log(option)
			http({
					url: '/car/list',
					params: {
						page: 1,
						limit: 10000,
						carnum: option.carNum
					}
				})
				.then(({
					data
				}) => {
					console.log(data)
					this.tableData = data[0]
				})
		}
	}
</script>

<style lang="less" scoped>
	.carDetail {
		margin-top: 60rpx;
		padding: 0 30rpx;

		text {
			display: block;
			text-align: center;
			font-size: 26rpx;

		}

		.defails-item {
			padding-top: 40rpx;
			padding-left: 38rpx;
			padding-right: 38rpx;
			display: flex;
			flex-direction: column;
			align-items: flex-start;
			border-radius: 10rpx;
			margin-bottom: 42rpx;
			// box-shadow: 0px 0px 15rpx rgba(0, 0, 0, .2);

			.item-title {
				width: 100%;
				display: flex;
				margin-bottom: 40rpx;
				align-items: center;
				justify-content: flex-start;
				position: relative;

				view:nth-child(1) {
					width: 16rpx;
					height: 34rpx;
					background-color: #056cff;
					border-radius: 8rpx;
				}

				view:nth-child(2) {
					margin-left: 20rpx;
					font-size: 32rpx;

				}

				view:nth-child(3) {
					margin-left: 20rpx;
					font-size: 28rpx;
					color: #0160ff;
					position: absolute;
					right: 0;
					top: 0;
				}
			}

			.item-content {
				width: 100%;
				display: flex;
				flex-direction: column;
				align-items: flex-start;

				.row {
					display: flex;
					width: 100%;
					justify-content: flex-start;
					padding: 30rpx 0;
					border-bottom: 1px solid #eee;

					text:nth-child(1) {
						color: #a8a8a8;
						text-align: left;
						width: 170rpx;
					}
				}

				.row:last-child {
					border: 0px;
				}

			}

			.host {
				.row {
					text:nth-child(1) {
						width: 200rpx;
					}
				}

				.photo {
					padding-top: 30rpx;

					text:nth-child(1) {
						color: #a8a8a8;
						text-align: left;
						margin-bottom: 30rpx;
					}

					#t1 {
						margin-bottom: 40rpx;
					}

					.t2 {
						margin-bottom: 170rpx;
					}
				}
			}
		}

		.operate {
			width: 100%;
			height: 140rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			position: fixed;
			left: 0rpx;
			bottom: 0rpx;
			background-color: #ffffff;
			border-top: 1px solid #ccc;

			view {
				width: 334rpx;
				height: 82rpx;
				text-align: center;
				line-height: 82rpx;
				border-radius: 8rpx;
				font-size: 32rpx;
			}

			.edit {
				background-color: #006fff;
				color: white;
				margin-right: 16rpx;
			}

			.del {
				background-color: white;
				color: #f35858;
				border: 1px solid #f35858;
			}
		}

		.tishi {
			margin: 300rpx auto;
			width: 600rpx;
			background-color: white;
			border-radius: 8rpx;

			.tishi-top {
				height: 150rpx;
				padding-left: 50rpx;
				line-height: 150rpx;
			}

			.tishi-sel {
				border-top: 1px solid #eee;
				display: flex;
				align-items: c1;

				text {
					flex: 1;
					height: 80rpx;

					text-align: center;
					line-height: 80rpx;
					font-size: 32rpx;

				}

				navigator {
					flex: 1;
				}

				text:nth-child(1) {
					border-right: 1px solid #eee;
				}
			}
		}
	}
</style>
